package com.wenyu.wenyuyuedu.utils;

import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.wenyu.wenyuyuedu.R;
import com.wenyu.wenyuyuedu.activity.LoginActivity;

import static anetwork.channel.http.NetworkSdkSetting.context;

/**
 * Created by Administrator on 2017/3/15.
 * 待修改
 */

public class TokenUtils {
    android.app.AlertDialog ad;
    private TextView quxiao;
    private TextView queding;
    /*显示登陆的dialog*/
    private void showLoginDoalog() {

        ad = new android.app.AlertDialog.Builder(context).create();
        ad.show();
        Window window = ad.getWindow();
        window.setContentView(R.layout.dailog_login);
        quxiao = (TextView) window.findViewById(R.id.dialog_login_quxiao);
        queding = (TextView) window.findViewById(R.id.dialog_login_queding);
        quxiao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ad.dismiss();
            }
        });
        queding.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(context, LoginActivity.class);
               // startActivity(intent);
               // finish();
                ad.dismiss();
            }
        });
    }
}
